| Fully Qualified Name: | Laminas\View\Helper\Navigation |
| Extends: | AbstractHelper |
Proxy helper for retrieving navigational helpers and forwarding calls
| Name | Description | Defined By |
|---|---|---|
| __call() | Magic overload: Proxy to other navigation helpers or the container | Navigation |
| __invoke() | Helper entry point | Navigation |
| __toString() | Magic overload: Proxy to {@link render()}. | AbstractHelper |
| accept() | Determines whether a page should be accepted when iterating | AbstractHelper |
| findActive() | Finds the deepest active page in the given container | AbstractHelper |
| findHelper() | Returns the helper matching $proxy | Navigation |
| getAcl() | Returns ACL or null if it isn't set using {@link setAcl()} or {@link setDefaultAcl()} | AbstractHelper |
| getContainer() | Returns the navigation container helper operates on by default | AbstractHelper |
| getDefaultProxy() | Returns the default proxy to use in {@link render()} | Navigation |
| getEventManager() | Get the event manager, if present. | AbstractHelper |
| getIndent() | Returns indentation | AbstractHelper |
| getInjectAcl() | Returns whether ACL should be injected when proxying | Navigation |
| getInjectContainer() | Returns whether container should be injected when proxying | Navigation |
| getInjectTranslator() | Returns whether translator should be injected when proxying | Navigation |
| getMaxDepth() | Returns maximum depth a page can have to be included when rendering | AbstractHelper |
| getMinDepth() | Returns minimum depth a page must have to be included when rendering | AbstractHelper |
| getPluginManager() | Retrieve plugin loader for navigation helpers | Navigation |
| getRenderInvisible() | Return renderInvisible flag | AbstractHelper |
| getRole() | Returns ACL role to use when iterating pages, or null if it isn't set using {@link setRole()} or {@link setDefaultRole()} | AbstractHelper |
| getServiceLocator() | Get the service locator. | AbstractHelper |
| getUseAcl() | Returns whether ACL should be used | AbstractHelper |
| hasAcl() | Checks if the helper has an ACL instance | AbstractHelper |
| hasContainer() | Checks if the helper has a container | AbstractHelper |
| hasRole() | Checks if the helper has an ACL role | AbstractHelper |
| htmlify() | Returns an HTML string containing an 'a' element for the given page | AbstractHelper |
| render() | Renders helper | Navigation |
| setAcl() | Sets ACL to use when iterating pages | AbstractHelper |
| setContainer() | Sets navigation container the helper operates on by default | AbstractHelper |
| setDefaultAcl() | Sets default ACL to use if another ACL is not explicitly set | AbstractHelper |
| setDefaultProxy() | Sets the default proxy to use in {@link render()} | Navigation |
| setDefaultRole() | Sets default ACL role(s) to use when iterating pages if not explicitly set later with {@link setRole()} | AbstractHelper |
| setEventManager() | Set the event manager. | AbstractHelper |
| setIndent() | Set the indentation string for using in {@link render()}, optionally a number of spaces to indent with | AbstractHelper |
| setInjectAcl() | Sets whether ACL should be injected when proxying | Navigation |
| setInjectContainer() | Sets whether container should be injected when proxying | Navigation |
| setInjectTranslator() | Sets whether translator should be injected when proxying | Navigation |
| setMaxDepth() | Sets the maximum depth a page can have to be included when rendering | AbstractHelper |
| setMinDepth() | Sets the minimum depth a page must have to be included when rendering | AbstractHelper |
| setPluginManager() | Set manager for retrieving navigation helpers | Navigation |
| setRenderInvisible() | Render invisible items? | AbstractHelper |
| setRole() | Sets ACL role(s) to use when iterating pages | AbstractHelper |
| setServiceLocator() | Set the service locator. | AbstractHelper |
| setUseAcl() | Sets whether ACL should be used | AbstractHelper |
| setView() | Set the View object | Navigation |
Magic overload: Proxy to other navigation helpers or the container
Examples of usage from a view script or layout:
// proxy to Menu helper and render container:
echo $this->navigation()->menu();
// proxy to Breadcrumbs helper and set indentation: $this->navigation()->breadcrumbs()->setIndent(8);
// proxy to container and find all pages with 'blog' route: $blogPages = $this->navigation()->findAllByRoute('blog');
| Parameter Name | Type | Description |
|---|---|---|
| $method | string | helper |
| $arguments | array | [optional] |
Returns: mixed returns what the proxied call returns
Helper entry point
| Parameter Name | Type | Description |
|---|---|---|
| $container | string|\AbstractContainer | container |
Returns: \Navigation
Magic overload: Proxy to {@link render()}.
This method will trigger an E_USER_ERROR if rendering the helper causes an exception to be thrown.
Implements {@link HelperInterface::__toString()}.
Returns: string
Determines whether a page should be accepted when iterating
Default listener may be 'overridden' by attaching listener to 'isAllowed' method. Listener must be 'short circuited' if overriding default ACL listener.
Rules:
| Parameter Name | Type | Description |
|---|---|---|
| $page | \AbstractPage | page |
| $recursive | bool | [optional] |
Returns: bool Whether page should be accepted
Finds the deepest active page in the given container
| Parameter Name | Type | Description |
|---|---|---|
| $container | \Navigation\AbstractContainer | container |
| $minDepth | int|null | [optional] |
| $maxDepth | int|null | [optional] |
Returns: array an associative array with the values 'depth' and 'page', or an empty array if not found
Returns the helper matching $proxy
The helper must implement the interface {@link Laminas\View\Helper\Navigation\Helper}.
| Parameter Name | Type | Description |
|---|---|---|
| $proxy | string | helper |
| $strict | bool | [optional] |
Returns: \Laminas\View\Helper\Navigation\HelperInterface helper instance
Returns ACL or null if it isn't set using {@link setAcl()} or {@link setDefaultAcl()}
Implements {@link HelperInterface::getAcl()}.
Returns: \Acl\AclInterface|null ACL object or null
Returns the navigation container helper operates on by default
Implements {@link HelperInterface::getContainer()}.
If no container is set, a new container will be instantiated and stored in the helper.
Returns: \Navigation\AbstractContainer navigation container
Returns the default proxy to use in {@link render()}
Returns: string
Get the event manager, if present.
Internally, the helper will lazy-load an EM instance the first time it requires one, but ideally it should be injected during instantiation.
Returns: null|\EventManagerInterface
Returns indentation
Returns: string
Returns whether ACL should be injected when proxying
Returns: bool
Returns whether container should be injected when proxying
Returns: bool
Returns whether translator should be injected when proxying
Returns: bool
Returns maximum depth a page can have to be included when rendering
Returns: int|null
Returns minimum depth a page must have to be included when rendering
Returns: int|null
Retrieve plugin loader for navigation helpers
Lazy-loads an instance of Navigation\HelperLoader if none currently registered.
Returns: \Navigation\PluginManager
Return renderInvisible flag
Returns: bool
Returns ACL role to use when iterating pages, or null if it isn't set using {@link setRole()} or {@link setDefaultRole()}
Implements {@link HelperInterface::getRole()}.
Returns: string|\Acl\Role\RoleInterface|null
Get the service locator.
Used internally to pull named navigation containers to render.
Returns: \ContainerInterface
Returns whether ACL should be used
Implements {@link HelperInterface::getUseAcl()}.
Returns: bool
Checks if the helper has an ACL instance
Implements {@link HelperInterface::hasAcl()}.
Returns: bool
Checks if the helper has a container
Implements {@link HelperInterface::hasContainer()}.
Returns: bool
Checks if the helper has an ACL role
Implements {@link HelperInterface::hasRole()}.
Returns: bool
Returns an HTML string containing an 'a' element for the given page
| Parameter Name | Type | Description |
|---|---|---|
| $page | \AbstractPage | page |
Returns: string HTML string (<a href="…">Label</a>)
Renders helper
| Parameter Name | Type | Description |
|---|---|---|
| $container | \AbstractContainer |
Returns: string
Sets ACL to use when iterating pages
Implements {@link HelperInterface::setAcl()}.
| Parameter Name | Type | Description |
|---|---|---|
| $acl | \Acl\AclInterface | ACL |
Returns: \AbstractHelper
Sets navigation container the helper operates on by default
Implements {@link HelperInterface::setContainer()}.
| Parameter Name | Type | Description |
|---|---|---|
| $container | string|\Navigation\AbstractContainer | Default |
Returns: \AbstractHelper
Sets default ACL to use if another ACL is not explicitly set
| Parameter Name | Type | Description |
|---|---|---|
| $acl | \Acl\AclInterface | [optional] |
Returns: void
Sets the default proxy to use in {@link render()}
| Parameter Name | Type | Description |
|---|---|---|
| $proxy | string | default |
Returns: \Navigation
Sets default ACL role(s) to use when iterating pages if not explicitly set later with {@link setRole()}
| Parameter Name | Type | Description |
|---|---|---|
| $role | mixed | [optional] |
Returns: void
Set the event manager.
| Parameter Name | Type | Description |
|---|---|---|
| $events | \EventManagerInterface |
Returns: \AbstractHelper
Set the indentation string for using in {@link render()}, optionally a number of spaces to indent with
| Parameter Name | Type | Description |
|---|---|---|
| $indent | string|int |
Returns: \AbstractHelper
Sets whether ACL should be injected when proxying
| Parameter Name | Type | Description |
|---|---|---|
| $injectAcl | bool |
Returns: \Navigation
Sets whether container should be injected when proxying
| Parameter Name | Type | Description |
|---|---|---|
| $injectContainer | bool |
Returns: \Navigation
Sets whether translator should be injected when proxying
| Parameter Name | Type | Description |
|---|---|---|
| $injectTranslator | bool |
Returns: \Navigation
Sets the maximum depth a page can have to be included when rendering
| Parameter Name | Type | Description |
|---|---|---|
| $maxDepth | int | Default |
Returns: \AbstractHelper
Sets the minimum depth a page must have to be included when rendering
| Parameter Name | Type | Description |
|---|---|---|
| $minDepth | int | Default |
Returns: \AbstractHelper
Set manager for retrieving navigation helpers
| Parameter Name | Type | Description |
|---|---|---|
| $plugins | \Navigation\PluginManager |
Returns: \Navigation
Render invisible items?
| Parameter Name | Type | Description |
|---|---|---|
| $renderInvisible | bool |
Returns: \AbstractHelper
Sets ACL role(s) to use when iterating pages
Implements {@link HelperInterface::setRole()}.
| Parameter Name | Type | Description |
|---|---|---|
| $role | mixed | [optional] |
Returns: \AbstractHelper
Set the service locator.
Used internally to pull named navigation containers to render.
| Parameter Name | Type | Description |
|---|---|---|
| $serviceLocator | \ContainerInterface |
Returns: \AbstractHelper
Sets whether ACL should be used
Implements {@link HelperInterface::setUseAcl()}.
| Parameter Name | Type | Description |
|---|---|---|
| $useAcl | bool |
Returns: \AbstractHelper
Set the View object
| Parameter Name | Type | Description |
|---|---|---|
| $view | \Renderer |
Returns: self